﻿from subprocess import *
import logging
log_file = 'father.log'
log_level = logging.DEBUG
logging.basicConfig(filename=log_file, level=log_level)
logger = logging.getLogger()
p=Popen(["son"],shell=True,stdin=PIPE,stdout=PIPE,bufsize=0, universal_newlines=True)
#p=Popen(["pachi"],shell=True,stdin=PIPE,stdout=PIPE,stderr=PIPE)
#p.stdin.write('Hello,son.\n'.encode('GBK'))
p.stdin.write('Hello,son.\n')
lines = p.stdout.readline()
logger.debug(lines)